package application

import (
	"ruoyi-go-echo-ddd/internal/domain/model"
	"ruoyi-go-echo-ddd/internal/domain/service"

	"github.com/labstack/echo/v4"
)

type SysUserPostApplication struct {
	UserPostService service.SysUserPostService
}

func NewSysUserPostApplication(u service.SysUserPostService) *SysUserPostApplication {
	return &SysUserPostApplication{
		UserPostService: u,
	}
}

func (s *SysUserPostApplication) BatchInsert(e echo.Context, list []*model.SysUserPost) (int64, error) {
	return s.UserPostService.BatchInsert(e.Request().Context(), list)
}

func (s *SysUserPostApplication) DeleteByUserId(e echo.Context, userId int64) (int64, error) {
	return s.UserPostService.DeleteByUserId(e.Request().Context(), userId)
}
